package com.cw.demo.bootstrap;

import com.alibaba.fastjson2.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/")
public class CallPoliceController {

  @Autowired
  private MessageSourceHandler messageSourceHandler;

  @RequestMapping("/testi18n")
  public JSONObject receive() {
    JSONObject data = new JSONObject();
    String userName = messageSourceHandler.locale("user.name");
    log.info(userName);
    return data;
  }
}
